<template>
    <div>
      <div class="title-text">推荐</div>
      <!--cell-->
      <ul>
        <router-link
          tag="li"
          class="item border-bottom"
          v-for="obj in recommendlist"
          :key="obj.id"
          to="/detail/obj.id"
        >
          <img  class="item-img" :src="obj.imgUrl">
          <div class="item-info">
            <p class="item-title">{{obj.title}}</p>
            <p class="item-desc">{{obj.desc}}</p>
            <button class="item-buttom">查看详情</button>
          </div>
        </router-link>
      </ul>
    </div>
</template>

<script>
export default {
  name: 'Recommand',
  props: {
    recommendlist: Array
  }
}
</script>

<style lang="stylus" scoped>
  .title-text {
    line-height: .6rem;
    padding-left: .2rem;
  }
  .item {
    display: flex;
  }
  .item-img {
    width: 1.7rem;
    height: 1.7rem;
    padding: 0.1rem;
  }
  .item-info {
    flex: 1;
    padding: 0.1rem;
    min-width: 0;
  }
  .item-title {
    line-height: .54rem;
    font-size: .32rem;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
  }
  .item-desc {
    line-height: .4rem;
    color: #ccc;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
  }
  .item-buttom {
    background: #ff9300;
    padding: 0 .1rem;
    border-radius: .06rem;
    color: #fff;
    margin-top: .16rem;
  }
</style>
